package com.yulin.activiti;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.ExecutionListener;

public class CheckMapContains implements ExecutionListener  {
	private static List<String> list = new ArrayList<String>();
	static{
		list.add("yj");
		list.add("yjbl");
	}

	@Override
	public void notify(DelegateExecution execution) throws Exception {
		// TODO Auto-generated method stub
		boolean flag = true;
		Map<String,Object> map = execution.getVariables();
		Set<String> set = map.keySet();
		for (String str : set) {
			if(!list.contains(str)){
				flag = false;
			}
		}
		execution.setVariable("flag", flag);
	}
}
